package com.hs.wa.service;

import com.hs.wa.dao.RuleEmployeeMapper;
import com.hs.wa.entity.RuleEmployee;
import com.hs.wa.entity.RuleEmployeeCondition;
import com.hs.wa.entity.RuleEmployeeKey;
import com.hs.wa.entity.Ruleconfig;

import java.util.List;

public class RuleEmployeeService {

	private RuleEmployeeMapper ruleEmployeeMapper;

	public List<RuleEmployee> selectRuleEmployee() {
		RuleEmployeeCondition ruleEmployeeCondition = new RuleEmployeeCondition();
		ruleEmployeeCondition.createCriteria().andIndexnameIsNotNull();
		return ruleEmployeeMapper.selectByExample(ruleEmployeeCondition);
	}

	public boolean updateRuleEmployee(RuleEmployee ruleEmployee) {
		boolean flag = false;
		RuleEmployeeCondition ruleEmployeeCondition = new RuleEmployeeCondition();
		ruleEmployeeCondition.createCriteria().andNoEqualTo(ruleEmployee.getNo()).andStatusEqualTo("0");
		int i = ruleEmployeeMapper.updateByExample(ruleEmployee, ruleEmployeeCondition);
		if (i > 0) {
			flag = true;
		}
		return flag;
	}
}
